package com.weilai.dao;

import com.weilai.domain.Captcha;
import com.weilai.domain.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface CaptchaDao {
    //按email查询验证码
    @Select("SELECT captcha_code FROM captcha where email=#{email}")
    public Captcha getByEamil(String email);

    //修改验证码
    @Update("UPDATE captcha SET captcha_code = #{captchaCode} WHERE email=#{email}")
    public void updateCode(Captcha captcha);

    //验证码注册
    @Insert("INSERT INTO captcha (email, captcha_code) VALUES (#{email},#{captchaCode});")
    public void insertCaptcha(Captcha captcha);
}
